{% extends "CmsBundle::base.html.twig" %}

{% block pluginStyles %}
    <link rel="stylesheet" href="/assets/cms/css/chosen.min.css" />
{% endblock %}

{% block pageContent %}
    <div class="col-xs-12">
    <!-- PAGE CONTENT BEGINS -->
        <form class="form-horizontal" role="form" action="{{ path("yearnfar_cms_user_edit") }}" method="post">
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 名称： </label>
                <div class="col-sm-9">
                    <input type="hidden" name="uid" class="col-xs-10 col-sm-5" value="{{ current.id }}">
                    <input type="text" name="username" class="col-xs-10 col-sm-5" value="{{ current.username }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 邮箱： </label>
                <div class="col-sm-9">
                    <input type="text" name="email" class="col-xs-10 col-sm-5" value="{{ current.email }}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 用户组： </label>
                <div class="col-sm-9">
                    <select class="width-20 chosen-select" name="role" id="form-field-select-3" data-placeholder="上一级菜单">
                        {% for item in groups %}
                            {% if current.roles and item.role==current.roles[0] %}
                                <option value="{{ item.role }}" selected="selected">{{ item.name }}</option>
                            {% else %}
                                <option value="{{ item.role }}">{{ item.name }}</option>
                            {% endif %}
                        {% endfor %}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 密码： </label>
                <div class="col-sm-9">
                    <input type="password" name="password" class="col-xs-10 col-sm-5" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 权限： </label>
                <div class="col-sm-9">
                    <input type="text" name="privilege" class="col-xs-10 col-sm-5" value="">
                </div>
            </div>
            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit" name="submit" value="1">
                        <i class="icon-ok bigger-110"></i>
                        提交
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="icon-undo bigger-110"></i>
                        重置
                    </button>
                </div>
            </div>
        </form>
    <!-- PAGE CONTENT ENDS -->
    </div><!-- /.col -->
{% endblock %}

{% block pluginScripts %}
    <script src="/assets/cms/js/chosen.jquery.min.js"></script>
{% endblock %}

{% block inlineScripts %}
    <script type="text/javascript">
        $(".chosen-select").chosen();
    </script>
{% endblock %}